Quiz 6

Question # 1

Q

Why adding or dropping a column from a very large table may be a bad idea?

A)

Adding or removing columns causes a table to be rebuilt and can be an expensive operation for a very large table.

B)

There’s no disadvantage to adding or dropping a column of the table.

C)

The operation can only be expensive if the column being dropped is used as a foreign key.

Question # 2

Q

Consider the following table with only two rows:

Table A

Name
Robert De Niro
NULL

Will the INNER JOIN and LEFT JOIN of the above table with itself give the same result?

A)

The result of INNER JOIN and LEFT JOIN is the same.

B)

The result of RIGHT JOIN and LEFT JOIN is the same.

C)

The result of INNER JOIN and RIGHT JOIN is the same.

Question # 3

Q

Consider two tables A and B.

SELECT * FROM
RIGHT JOIN B
ON A.col = B.col;

and,

SELECT * FROM
LEFT JOIN A
ON A.col = B.col;

Will the output of the above two be different barring the order in which the columns appear in a row?

A)

No

B)

Yes

Question # 4

Q

Consider the query:

REPLACE INTO Actors(ActorId, FirstName, SecondName)
VALUES(13, 'Will', 'Smith');

A trigger xyz associated with Actors table is fired when REPLACE is executed.

A)

The MySQL REPLACE statement inserts the row if there is no duplicate key error, otherwise it deletes the row causing the error before inserting the new row. An INSERT trigger will be fired when REPLACE statement is executed.

B)

No trigger will be fired when REPLACE statement is executed because in MySQL triggers can only be associated with three DML statements.

Question # 5

Q

Consider the query:

TRUNCATE TABLE Actors;

A trigger xyz associated with Actors table is fired when TRUNCATE is executed.

A)

DELETE trigger is fired because the TRUNCATE TABLE statement works like a DELETE statement without a WHERE clause which deletes all rows from a table.

B)

No triggers are fired because TRUNCATE is a sequence of DROP TABLE and CREATE TABLE statements. It does not use DELETE statement so, a delete trigger associated with the table that is being truncated is not fired.

Quiz 5
Quiz 7
Mark as Completed
Report an Issue